package com.cao.meet.mvp.presenter;

import android.content.Context;
import android.os.Looper;

import com.cao.meet.activity.LoginActivity;
import com.cao.meet.mvp.contract.LoginContract;
import com.cao.meet.mvp.model.LoginModel;

/**
 * Created by ZKTH
 * Time ： 2018/12/20.10:05
 * data ：
 */

public class LoginPresenter implements LoginContract.Presenter {

    private String login_json = null;

    @Override
    public void login(Context context, String user_name, String pass_word) {
        LoginContract.Model login_model = new LoginModel();
        login_model.login(context,user_name,pass_word);
    }

    @Override
    public void show_message(Context context,String json) {
        Looper.prepare();
        LoginContract.View view = new LoginActivity();
        view.showToast(json);
        Looper.loop();
    }

    @Override
    public void getResult(String json,ResultInter inter){
        inter.terurn_json(login_json);
    }

    public interface ResultInter{
        void terurn_json(String json);
    }

}
